#import "DDExchangeView.h"
@interface DDExchangeView()
@property (nonatomic, strong) CCLabel *titleLBL;
@property (nonatomic, strong) CCLabel *dateLBL;
@property (nonatomic, strong) CCLabel *moneyLBL;
@property (nonatomic, strong) CCLabel *tipsLBL;
@end
@implementation DDExchangeView
- (instancetype)init
{
    self = [super init];
    if (self)
    {
        self.backgroundColor = [UIColor whiteColor];
        self.layer.cornerRadius = 5.0;
        self.layer.masksToBounds = YES;
    }
    return self;
}
- (CCLabel *)titleLBL
{
    if (!_titleLBL)
    {
        _titleLBL = [[CCLabel alloc] init];
        _titleLBL.font = FONT(UIFontWeightBold, 17);
        _titleLBL.textColor = TEXT_BLACK_COLOR;
        [self addSubview:_titleLBL];
        _titleLBL.c_left.c_equal(self).with.coffset(GAP);
        _titleLBL.c_top.c_equal(self).with.coffset(GAP);
    }
    return _titleLBL;
}
- (CCLabel *)moneyLBL
{
    if (!_moneyLBL)
    {
        _moneyLBL = [[CCLabel alloc] init];
        _moneyLBL.font = FONT(UIFontWeightBold, 17);
        _moneyLBL.textColor = RED_COLOR;
        [self addSubview:_moneyLBL];
        _moneyLBL.c_right.c_equal(self).with.coffset(-GAP);
        _moneyLBL.c_bottom.c_equal(self.c_centerY).with.coffset(-GAP);
    }
    return _moneyLBL;
}
- (CCLabel *)dateLBL
{
    if (!_dateLBL)
    {
        _dateLBL = [[CCLabel alloc] init];
        _dateLBL.font = FONT(UIFontWeightLight, 14);
        _dateLBL.textColor = TEXT_GRAY_COLOR;
        [self addSubview:_dateLBL];
        _dateLBL.c_left.c_equal(self).with.coffset(GAP);
        _dateLBL.c_top.c_equal(self.c_centerY).with.coffset(GAP);
    }
    return _dateLBL;
}
- (CCLabel *)tipsLBL
{
    if (!_tipsLBL)
    {
        _tipsLBL = [[CCLabel alloc] init];
        _tipsLBL.font = FONT(UIFontWeightLight, 14);
        _tipsLBL.textColor = TEXT_GRAY_COLOR;
        [self addSubview:_tipsLBL];
        _tipsLBL.c_right.c_equal(self).with.coffset(-GAP);
        _tipsLBL.c_top.c_equal(self.c_centerY).with.coffset(GAP);
    }
    return _tipsLBL;
}
- (void)setTitle:(NSString *)title
{
    if (_title != title)
    {
        _title = title;
        self.titleLBL.text = _title;
    }
}
- (void)setDate:(NSString *)date
{
    if (_date != date)
    {
        _date = date;
        self.dateLBL.text = [NSString stringWithFormat:@"有效期至: %@",_date];
    }
}
- (void)setMoney:(NSString *)money
{
    if (_money != money)
    {
        _money = money;
        self.moneyLBL.text = [NSString stringWithFormat:@"¥ %@",_money];
    }
}
- (void)setTips:(NSString *)tips
{
    if (_tips != tips)
    {
        _tips = tips;
        self.tipsLBL.text = _tips;
    }
}

@end
